package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name="刘芳琳";
        int age=18;
        String gender="火星居民";
        String[] otherInfo={"糖豆","被刺队友","大长指甲"};
        Person p=new Person(name, otherInfo,gender, age);
        System.out.println(p);

        FileOutputStream fos=new FileOutputStream("糖豆.obj");
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        oos.writeObject(p);
        System.out.println("写出完毕");
        oos.close();
    }
}
